import Cookies from 'js-cookie'
const TokenKey = 'zheliguan_token'
const User_name = 'zheliguan_name'
const Account_type = 'zheliguan_account'
const buttonpermsStr = 'zheliguan_buttonpermsStr'
// 设置失效时间
var millisecond = new Date().getTime()
var expiresTime = new Date(millisecond + 60 * 1000 * 30)
// Cookies.set('name', 'value', {
// expires: expiresTime,
// });

export function getToken() {
  return Cookies.get(TokenKey)
}

export function setToken(token) {
  return Cookies.set(TokenKey, token, {
    expires: expiresTime
  })
}

export function removeToken() {
  return Cookies.remove(TokenKey)
}

export function setName(name) {
  return Cookies.set(User_name, name, {
    expires: expiresTime
  })
}

export function getName() {
  return Cookies.get(User_name)
}

export function removeName() {
  return Cookies.remove(User_name)
}

export function setAccount(account) {
  return Cookies.set(Account_type, account, {
    expires: expiresTime
  })
}

export function getAccount() {
  return Cookies.get(Account_type)
}

export function removeAccount() {
  return Cookies.remove(Account_type)
}

export function setButtonpermsStr(btuArr) {
  return Cookies.set(buttonpermsStr, btuArr, {
    expires: expiresTime
  })
}

export function getButtonpermsStr() {
  return Cookies.get(buttonpermsStr)
}

export function removeButtonpermsStr() {
  return Cookies.remove(buttonpermsStr)
}
